package com.code.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.code.utils.privacy.PrivacyEncrypt;
import com.code.utils.privacy.PrivacyTypeEnum;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 员工实体
 * @author admin
 */
@Data
public class Employee implements Serializable {

    private static final long serialVersionUID = 1L;

    private Long id;

    private String username;

    //@PrivacyEncrypt(type = PrivacyTypeEnum.NAME)
    private String name;

    //@PrivacyEncrypt(type = PrivacyTypeEnum.PASSWORD)
    private String password;

    @PrivacyEncrypt(type = PrivacyTypeEnum.PHONE) // 隐藏手机号
    private String phone;

    private String sex;

    //@PrivacyEncrypt(type = PrivacyTypeEnum.ID_CARD)
    private String idNumber;

    private Integer status;

    @TableField(fill = FieldFill.INSERT) // 插入时填充字段
    private LocalDateTime createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE) // 插入和更新时填充字段
    private LocalDateTime updateTime;

    @TableField(fill = FieldFill.INSERT) // 插入时填充字段
    private Long createUser;

    @TableField(fill = FieldFill.INSERT_UPDATE) // 插入和更新时填充字段
    private Long updateUser;

}
